package com.zjitc.obj;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/7 14:42
 * @description:
 */
public class Teacher {
/*注入*/
  @Autowired
  private User user;

  public User getUser() {
    return user;
  }

  //告诉spring容器，你需要在创建Teacher对象之后，重新在容器中寻找一个User对象，注入进来

  public void setUser(User user) {
    this.user = user;
  }
}
